﻿<?php
class MY_Controller extends CI_Controller {

	/**
	 * 檢查頁面是否存在
	 */
	protected function checkViewPage($page){
		if ( ! file_exists('application/views/items/'.$page.'.php')){ //頁面不存在
			show_404();
		}
	}
	
	public function go($category, $page, $data){
		$this->load->view("templates/header", $data); //加進表頭template
		if(empty($category)){
			$this->load->view($page, $data); 
		}else{
			$this->load->view($category."/".$page, $data);
		}
		$this->load->view('templates/footer', $data); //加進表尾template
	}
}
?>